package com.zgcs.sequence.net.in;

import java.util.ArrayList;

import com.zscg.sequence.data.User;

public class RoomUsersPackage extends InPackage {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7299125019317086283L;

	ArrayList<User> userList;

	int roomID;

	public RoomUsersPackage(String result) {
		super(result);
	}

	@Override
	public void parserSelf() {

		roomID = Integer.parseInt(resultSpl[2]);
		userList = new ArrayList<User>();
		for (int i = 3; i < resultSpl.length; i += 5) {
			User user = new User();
			user.setUserId(Integer.parseInt(resultSpl[i]));
			user.setUserNickName(resultSpl[i + 1]);
			user.setUserPhoto(resultSpl[i + 2]);
			user.setUserCash(Integer.parseInt(resultSpl[i + 3]));
			user.setUserState(Integer.parseInt(resultSpl[i + 4]));
			userList.add(user);
		}

	}

	public ArrayList<User> getUserList() {
		return userList;
	}

	public void setUserList(ArrayList<User> userList) {
		this.userList = userList;
	}

	public int getRoomID() {
		return roomID;
	}

	public void setRoomID(int roomID) {
		this.roomID = roomID;
	}

}
